import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/Home/home.vue'),

    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login/index.vue'),
    },
    {
      path: '/user',
      name: 'user',
      redirect: '/user/info',
      component: () => import('@/views/User/index.vue'),
      children: [
        {
          path: 'info',
          name: 'info',
          meta: {
            active:'info'
          },
          component: () => import('@/views/User/Info/index.vue'),
        },
        {
          path: 'walleat',
          name: 'walleat',
          meta: {
            active:'walleat'
          },
          component: () => import('@/views/User/walleat/index.vue'),
        },
        {
          path: 'chongzhi',
          name: 'chongzhi',
          meta: {
            active:'walleat'
          },
          component: () => import('@/views/User/walleat/chonzghi.vue'),
        }
      ]
    },
  ],
})

export default router
